package com.cart.utils;

/**
 * Created by lixiaodaoaaa on 2017/8/15.
 */

public class ProtocolUtils {

    //求加和 取低字节一个位字节数
    public static String getAddCheckResult(String checkData) {
        if (checkData == null || checkData.equals("")) {
            return "";
        }
        int result = 0;
        for (int i = 0; i < checkData.length(); i += 2) {
            result += Integer.parseInt(checkData.substring(i, i + 2), 16);
        }
        return FormatUtils.intValueTo4HexString(result).substring(2, 4);
    }
}
